]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Allow for empty WM_CLASS and _NET_WM_NAME in tray icons
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 24 Oct 2010 12:31:41 +0000 (14:31 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 25 Oct 2010 14:01:32 +0000 (16:01 +0200)
The system tray specification says the hint should be set, but some
icons leave it empty anyway. Don't throw exceptions in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=633028

js/ui/notificationDaemon.js
js/ui/statusIconDispatcher.js

index 59c48d59f679fd91c4790db8bc948b7ff9ccd1ef..61de6943fa278689b86a27aab1022d336592aeef 100644 (file)
@@ -372,7 +372,7 @@ NotificationDaemon.prototype = {
     _onTrayIconAdded: function(o, icon) {
         let source = this._sources[icon.pid];
         if (!source)
-            source = this._newSource(icon.title, icon.pid);
+            source = this._newSource(icon.title || icon.wm_class || _("Unknown"), icon.pid);
         source.setTrayIcon(icon);
     },
 
index fc754c9f4a4339edadf90cb8ad83c4e6692d4e2c..8c796acd643b969a22ec72b47ca701deca62b8c9 100644 (file)
@@ -36,7 +36,7 @@ StatusIconDispatcher.prototype = {
     },
 
     _onTrayIconAdded: function(o, icon) {
-        let wmClass = icon.wm_class.toLowerCase();
+        let wmClass = (icon.wm_class || 'unknown').toLowerCase();
         let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
         if (role)
             this.emit('status-icon-added', icon, role);
@@ -45,7 +45,7 @@ StatusIconDispatcher.prototype = {
     },
 
     _onTrayIconRemoved: function(o, icon) {
-        let wmClass = icon.wm_class.toLowerCase();
+        let wmClass = (icon.wm_class || 'unknown').toLowerCase();
         let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass];
         if (role)
             this.emit('status-icon-removed', icon);